<?php
/**
 * $Author: BEESSHOP $
 * ============================================================================
 * ============================================================================
 */
if(file_exists("../data/install.lock")){
    header("Location:../web/index.php");
}
$url_path = str_replace("install.php","",$_SERVER['PHP_SELF']);
$url = "http://".$_SERVER['HTTP_HOST'].$url_path;
if($_SERVER['HTTPS']){
    $url = "https://".$_SERVER['HTTP_HOST'].$url_path;
}
$replace_url = $url."install/";
$path_url = "install/images/js/app.js";
$js_content = file_get_contents($path_url);
$js_content = str_replace("{{url}}",$url,$js_content);
file_put_contents($path_url,$js_content);
$path_url = "install/images/css/css.css";
$css_content = file_get_contents($path_url);
$css_content = str_replace("{{url}}",$url,$css_content);
file_put_contents($path_url,$css_content);
$index_content = file_get_contents("install/index.html");
$index_content = str_replace("/beesshop/",$replace_url,$index_content);
echo $index_content;
